﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace Dashboard.ProductBonus.Business
{
    public class OEEReport:BusinessBase
    {
        public DataTable GetOEEReport(string dateFrom,string dateTo,string team,string staffNo)
        {
            string sql = "select * from OEEReport_View where [Date] >= '{0}' and [Date] <='{1}' ";
            sql = string.Format(sql, dateFrom, dateTo);
            if (!string.IsNullOrEmpty(team))
            {
                sql += " and Team='" + team + "'";
            }
            if (!string.IsNullOrEmpty(staffNo))
            {
                sql += " and StaffNumber='" + staffNo + "'";
            }
            return DbConnection.DataSet(sql).Tables[0];
        }
    }
}
